<%@ Page Language="C#" MasterPageFile="~/Administrator/AdminPage.master" AutoEventWireup="true"
    CodeFile="InsuranceTypeAdmin.aspx.cs" Inherits="Administrator_InsuranceTypeAdmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="titlefield">
        Insurance management
    </div>
    <div class="manafield">
        <p>
            <asp:Label ID="lblStatus" runat="server"></asp:Label>
        </p>
        <div class="field">
            <asp:Panel ID="pnlAddInsurance" runat="server">
                <p>
                    <asp:Label ID="lblAddInsurance" CssClass="lbl" Text="Insurance Type" 
                        runat="server"></asp:Label>
                    <asp:TextBox ID="txtAddInsurance" CssClass="txt" runat="server" Width="530px" 
                        ValidationGroup="add"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ErrorMessage="Insurance Type is required" 
                        ControlToValidate="txtAddInsurance" ValidationGroup="add">Insurance Type is required</asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Label ID="lblAddDescription" CssClass="lbl" Text="Description" 
                        runat="server"></asp:Label>
                    <asp:TextBox ID="txtAddDescription" CssClass="txt" TextMode="MultiLine" 
                        Columns="50" runat="server" Rows="4" Width="530px" ValidationGroup="add"></asp:TextBox>
                        <br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ErrorMessage="Description is required" 
                        ControlToValidate="txtAddDescription" ValidationGroup="add">Description is required</asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Button ID="btnAdd" runat="server" CssClass="btn" 
                        OnClick="btnAdd_Click" Text="Add" />
                    <asp:Button ID="btnCancelAdd" runat="server" CssClass="btn" 
                        OnClick="btnCancelAdd_Click" Text="Cancel" />
                </p>
            </asp:Panel>
            <asp:Panel ID="pnlEditInsurance" runat="server">
                <p>
                    <asp:Label ID="lblEditInsurance" CssClass="lbl" Text="Insurance Type" 
                        runat="server"></asp:Label>
                    <asp:TextBox ID="txtEditInsurance" CssClass="txt" runat="server" Width="530px" 
                        ValidationGroup="edit"></asp:TextBox>
                    <br />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ErrorMessage="Insurance Type is required" 
                        ControlToValidate="txtEditInsurance" ValidationGroup="edit">Insurance Type is required</asp:RequiredFieldValidator>

                </p>
                <p>
                    <asp:Label ID="lblEditDescription" CssClass="lbl" Text="Description" 
                        runat="server"></asp:Label>
                    <asp:TextBox ID="txtEditDescription" CssClass="txt" TextMode="MultiLine" 
                        Columns="50" runat="server" Rows="4" Width="530px" ValidationGroup="edit"></asp:TextBox>
                        <br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ErrorMessage="Description is required" 
                        ControlToValidate="txtEditDescription" ValidationGroup="edit">Description is required</asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Button ID="btnEdit" runat="server" CssClass="btn" OnClick="btnEdit_Click" 
                        Text="Edit" />
                    <asp:Button ID="btnCancelEdit" runat="server" CssClass="btn" 
                        OnClick="btnCancelEdit_Click" Text="Cancel" />
                </p>
            </asp:Panel>
            <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
        </div>
        <div>
            <div class="titleDataView">
                ALL Types of Insurances </div>
            <asp:GridView ID="grvInsurance" runat="server" AllowPaging="True" 
                BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="5px" 
                CellPadding="4" CellSpacing="2" CssClass="dataView" DataKeyNames="InsuranceId" 
                ForeColor="Black" onpageindexchanging="grvInsurance_PageIndexChanging" 
                onrowdeleting="grvInsurance_RowDeleting" 
                onrowediting="grvInsurance_RowEditing" AutoGenerateColumns="False" 
                AllowSorting="True" onsorting="grvInsurance_Sorting">
                <RowStyle BackColor="White" />
                <Columns>
                    <asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" />
                    <asp:ButtonField ButtonType="Button" CommandName="Delete" Text="Delete" />
                    <asp:BoundField DataField="InsuranceId" HeaderText="InsuranceId" 
                        ReadOnly="True" SortExpression="InsuranceId" />
                    <asp:BoundField DataField="InsuranceType" HeaderText="Type of Insurance" 
                        ReadOnly="True" SortExpression="InsuranceType" />
                    <asp:TemplateField HeaderText="Description" SortExpression="Description">
                        <ItemTemplate>
                            <%#util.StringExtensions(Eval("Description").ToString(), 20) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCCCC" />
                <PagerStyle BackColor="#CCFFFF" ForeColor="#003300" HorizontalAlign="Center" 
                    BorderColor="#999999" BorderStyle="Solid" BorderWidth="5px" Font-Size="Large" />
                <EmptyDataTemplate>
                    &nbsp;
                </EmptyDataTemplate>
                <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" 
                    Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
            </asp:GridView>
        </div>
    </div>
</asp:Content>
